import request from '@/config/axios'
import type { Dayjs } from 'dayjs'

/** 审核等级信息 */
export interface AuditLevel {
  id: number // id
  levelName?: string // 等级
  description: string // 描述
  configId: string // 审核项
}

// 审核等级 API
export const AuditLevelApi = {
  // 查询审核等级分页
  getAuditLevelPage: async (params: any) => {
    return await request.get({ url: `/business/audit-level/page`, params })
  },

  // 查询审核等级详情
  getAuditLevel: async (id: number) => {
    return await request.get({ url: `/business/audit-level/get?id=` + id })
  },

  // 新增审核等级
  createAuditLevel: async (data: AuditLevel) => {
    return await request.post({ url: `/business/audit-level/create`, data })
  },

  // 修改审核等级
  updateAuditLevel: async (data: AuditLevel) => {
    return await request.put({ url: `/business/audit-level/update`, data })
  },

  // 删除审核等级
  deleteAuditLevel: async (id: number) => {
    return await request.delete({ url: `/business/audit-level/delete?id=` + id })
  },

  /** 批量删除审核等级 */
  deleteAuditLevelList: async (ids: number[]) => {
    return await request.delete({ url: `/business/audit-level/delete-list?ids=${ids.join(',')}` })
  },

  // 导出审核等级 Excel
  exportAuditLevel: async (params) => {
    return await request.download({ url: `/business/audit-level/export-excel`, params })
  }
}
